using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace XDL.Framework.Particles
{
    public class LineSettings
    {
        /// <summary>
        /// Effect used to render this line system. 
        /// </summary>
        public Effect LineEffect;

        /// <summary>
        /// Shader technique.
        /// </summary>
        public string TechniqueName = null;

        /// <summary>
        /// Maximum number of lines that can be displayed at one time. 
        /// </summary>
        public int MaxLines = 1024;

        /// <summary>
        /// How long these particles will last (max). 
        /// </summary>
        public TimeSpan Duration = TimeSpan.FromSeconds(5);

        /// <summary>
        /// If greater than zero, some particles will last a shorter time than others. 
        /// </summary>
        /// <remarks>
        /// This value must be lower with the [0..1[ range.
        /// </remarks>
        public float DurationRandomness = 0;

        // Range of values controlling how much velocity to give each
        // particle. Values for individual particles are randomly chosen from somewhere
        // between these limits.
        public float MinVelocity = 0;
        public float MaxVelocity = 0;

        /// <summary>
        /// Direction and strength of the gravity effect.  
        /// </summary>
        /// <remarks>
        /// Note that this can point in any direction, not just down! The fire effect points it upward to make the flames
        /// rise, and the smoke plume points it sideways to simulate wind.
        /// </remarks>
        public Vector3 Gravity = Vector3.Zero;

        /// <summary>
        /// Controls how much particles are influenced by the velocity of the object
        /// which created them.
        /// </summary>
        /// <remarks>
        /// You can see this in action with the explosion effect,
        /// where the flames continue to move in the same direction as the source
        /// projectile. The projectile trail particles, on the other hand, set this
        /// value very low so they are less affected by the velocity of the projectile.
        /// </remarks>
        public float EmitterVelocitySensitivity = 0;

        /// <summary>
        /// Controls how the particle velocity will change over their lifetime
        /// </summary>
        /// <remarks>
        /// If set to 1, particles will keep going at the same speed as when they were created.
        /// If set to 0, particles will come to a complete stop right before they die.
        /// Values greater than 1 make the particles speed up over time.
        /// </remarks>
        public float EndVelocity = 1;

        // Range of values controlling the particle color and alpha. Values for
        // individual particles are randomly chosen from somewhere between these limits.
        public Color MinColor = Color.White;
        public Color MaxColor = Color.White;

        // Alpha blending settings.
        public BlendState BlendState = BlendState.AlphaBlend;

        /// <summary>
        /// Defines the ground level for basic rebound behavior.
        /// </summary>
        public Nullable<float> GroundLevel = null;
    }
}
